<template>
  <div></div>
</template>
<script>
export default {
  data() {
    return { loading: "" };
  },
  components: {},
  methods: {
    openLoading() {
      this.loading = this.$loading({
        lock: true,
        text: "Loading",
        spinner: "el-icon-loading",
        background: "rgba(0, 0, 0, 0.7)"
      });
    },
    addFunction: async function() {
      var postData = this.theAdd;
      var s = qs.stringify(postData);
      const responseData = await myhttp.post(api.saveGoodsType, s);
      if (responseData.data.result == "error") {
        msgError(this, responseData.data.msg);
      } else {
        msgSuccess(this, responseData.data.msg);
        this.isAdd = false;
        this.getAllList();
      }
    },
    doDelete: async function() {
      // var postData = {
      //   IDS: this.multiIDS.join()
      // };
      var postData = {
        in_warehouse_id: this.theRow.in_warehouse_id
      };
      var s = qs.stringify(postData);
      const responseData = await myhttp.post(api.deleteTable, s);
      if (responseData.data.result == "error") {
        msgError(this, responseData.data.msg);
      } else {
        msgSuccess(this, responseData.data.msg);
        this.isDelete = false;
        this.getAllList();
      }
    },
    doEditRemark: async function() {
      var postData = {
        in_warehouse_id: this.theRow.in_warehouse_id,
        remark: this.theRemark
      };
      var s = qs.stringify(postData);
      const responseData = await myhttp.post(api.updateRemark, s);
      if (responseData.data.result == "error") {
        msgError(this, responseData.data.msg);
      } else {
        msgSuccess(this, responseData.data.msg);
        this.isEditRemark = false;
        this.getAllList();
      }
    },
    getAllList: async function() {
      var postData = {
        in_warehouse_id: this.inWarehouseId, //单查时传入
        pageNum: 0,
        pageSize: 0
      };
      var s = qs.stringify(postData);
      const responseData = await myhttp.post(api.selectInDetails, s);
      this.tableData = responseData.data.items;
      if (responseData.data.result == "error") {
        msgError(this, responseData.data.msg);
      }
    }
  },
  created() {},
  mounted() {}
};
</script>
<style scoped>
</style>


